package com.kangye.exam.service.serviceimpl;

import com.kangye.exam.bean.WrongTopic;
import com.kangye.exam.dao.ItemErroDao;
import com.kangye.exam.service.ItemSercice;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service(value = "itemSercice")
public class ItemServiceImpl implements ItemSercice {

    @Resource
    private ItemErroDao itemErroDao;

    @Override
    //将学生id传入
    public List<WrongTopic> findItemAll(Integer studentId, Integer page, Integer limit) {
        Map<String,Object> map = new HashMap<>();
          map.put("page",page);
          map.put("limit",limit);
          map.put("studentId",studentId);
        return itemErroDao.findItemAll(map);
    }

    @Override
    public int getCount(Integer studentId) {
        return itemErroDao.getCount(studentId);
    }

    @Override
    public void delItem(Integer itemId,Integer studentId) {
        itemErroDao.delItem(itemId,studentId);
    }
}
